<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'weiye2.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
    <div id="dives">
					<div class="about-bottom">
						<c:forEach items="${list }" var="u">
							<div class="col-md-4 about-left">
								<img src="ImgshowSceneryServlet?fileName=${u.sceneryPhoto }"
									alt="" width="400;" height="400" />
								<h5><a  href='ToMapsServlet?id=${u.sceneryId}'>${u.sceneryName }</a></h5>
								<p>${u.ticketPrice }
								<p>
								<p>${u.sceneryIntroduce }</p>
							</div>
						</c:forEach>
						</br> </br> </br>
						</br> </br> </br>
						
						<center>
							<div style="width: 600px;height: 50px; margin: 0 auto ">
								<div style=" margin-left: 130px">
									<input type="button" onclick="shou()" value="首页"> <input
										type="button" onclick="shang(${page })" value="上一页"> <input
										type="button" onclick="xia(${page })" value="下一页"> <input
										type="button" onclick="wei()" value="尾页"> <span>当前页数[${page }]&nbsp;&nbsp;总页数[${pagecount}]</span>
								</div>
						</center>
					<script type="text/javascript">
var i=${page};
//尾页直接给一个最大值首页直接给1传入
var j=99;
var k=1;
/* alert(i); */
function shou() {
		$.post("SelectSceneryServlet?op=select4",{page:k+"/sy"},function(obj){		
			$("#dives").html(obj);
	}) 
}
function wei() {
		$.post("SelectSceneryServlet?op=select4",{page:j+"/wy"},function(obj){		
			$("#dives").html(obj);
	}) 
}
function shang(i) {	
	//方法必须传值,也就是当前index
	$.post("SelectSceneryServlet?op=select4",{page:i+"/s"},function(obj){		
		$("#dives").html(obj);//传本页数字加字母到weiyeServlet判断
}) 
}
function xia(i) {
	//方法必须传值,也就是当前index
	 $.post("SelectSceneryServlet?op=select4",{page:i+"/x"},function(obj){		
		$("#dives").html(obj);
})  
}
</script>
	</div>
  </body>
</html>
